<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 300px;height: 300px;background:pink;margin: 50px auto;
            line-height: 300px;text-align: center;
        }
    </style>
</head>
<body>
    <div class="box">张新同小帅逼</div>
</body>
<script>
    document.oncontextmenu=function(eve){
        var e=eve||window.event;
        // 正常浏览器下
        // e.preventDefault();
        // // IE浏览器下
        // e.returnValue=false;
        stopDefault(e);
    }


    function stopDefault(e){
        if(e.preventDefault){
            e.preventDefault()
        }else{
            e.returnValue = false;
        }
    }
</script>
</html>